import yaml
import os

# path = str(os.path.join(os.path.dirname(os.path.dirname(os.path.relpath(__file__),'datas'))) + '\login_yaml.yaml'
# print(path)

# print(path)


def get_yaml(yaml_file):
    with open(yaml_file, "r", encoding="utf-8") as fp:
        # 使用 yaml.safe_load 直接从文件对象中加载数据
        data = yaml.safe_load(fp)

    """打印解析后的数据"""
    # print(datas)
    return data

# # 调用函数并打印返回值
# result = get_yaml('E:/PythonProject/roncoo_pay/datas/login_yaml.yaml')
# print(result)